﻿@model Nullable<DateTime>
           
@{
    if (Model == null || Model == new DateTime(0001,01,01))
    {
        @Html.TextBox("", String.Empty, new { @class = "datefield", type = "date" })
    }
    else
    {
        DateTime dt = (DateTime)Model;
        @Html.TextBox("", String.Format("{0:d}", dt.ToShortDateString()), new { @class = "datefield", type = "date" })
    }
}